﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Business;
using System.Drawing;

namespace WebApplication1
{
    public partial class Food : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)    
        {
            BindFood();
            
        }

        public string GetImage(object img)
        {
            byte[] image = (byte[])img;

            byte[]  newBytes = Common.convertImageSize(image);

          
            return "data:image/jpg;base64," + Convert.ToBase64String(newBytes);
        }


        private void BindFood()
        {
           
                Business.Food fo = new Business.Food();
                List<fos_Food> foodList = fo.GetLatestFood();
                Repeater1.DataSource = foodList;
                Repeater1.DataBind();
            

        }

        protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
              object data = e.Item.DataItem;

            
        }
    }
}